package com.share.shrimpcolo;

public class UseStringBuffer {
	public static void main(String args[]) {
		StringBuffer sb1 = new StringBuffer();
		StringBuffer sb2 = new StringBuffer(15);
		StringBuffer sb3 = new StringBuffer("Hello,my friends!");
		
		char cArray[] = { 'w', 'h', 'y', ' ' };
		sb1.append("are you empty?");
		System.out.println(sb1);
		
		sb2.append(cArray);
		System.out.println(sb2);
		
		sb3.append(sb1);
		System.out.println(sb3);
		
		for (int i = 0, j = 17; i < cArray.length; i++) {
			if (cArray[i] > 0)
				sb3.insert(j++, cArray[i]);
		}
		System.out.println(sb3);
	}
}
